import request from "@/utils/request";

export default {
  getOrderRemarkList() {
    return request({
      url: "/orderRemark/list",
      method: "get",
    });
  },

  getOrderRemarkById(id) {
    return request({
      url: `/orderRemark/${id}`,
      method: "get",
    });
  },

  addOrder(orderRemark) {
    // 处理订单的时间

    return request({
      url: "/orderRemark",
      method: "post",
      data: orderRemark,
    });
  },

  updateorderRemark(orderRemark) {
    return request({
      url: `/orderRemark`,
      method: "put",
      data: orderRemark,
    });
  },

  deleteOrderRemarkById(id) {
    return request({
      url: `/orderRemark/${id}`,
      method: "delete",
    });
  },

  saveOrderRemark(orderRemark) {
    if (orderRemark.id == null && orderRemark.id == undefined) {
      return this.addOrder(orderRemark);
    }
    return this.updateorderRemark(orderRemark);
  },
};
